<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div class="box">文字</div>
  <script>
    var oBox = document.querySelector(".box");
    oBox.style.color = "red";
    oBox.style.width = "200px";
    oBox.style.height = "200px";
    oBox.style.backgroundColor = "green";
    // 使用此种方法，css的引入方式是行内样式，需要注意的是权重值问题
  </script>
</body>
</html>